//
//  ILCSearchViewController.m
//  ILCSearch
//
//  Created by lirenqiang on 2016/11/11.
//  Copyright © 2016年 Ninja. All rights reserved.
//

#import "ILCSearchViewController.h"

@interface ILCSearchViewController ()
@property (nonatomic, strong) UISearchController *searchController;
@end

@implementation ILCSearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIView *view = [UIView new];
    view.frame = CGRectMake(0, 64, kScreenW, kScreenH-64);
    view.backgroundColor = [UIColor blueColor];
    [self.view addSubview:view];
    [view addSubview:self.searchController.searchBar];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (UISearchController *)searchController
{
    if (!_searchController) {

        
        _searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
//        _searchController.searchResultsUpdater = self;
        _searchController.dimsBackgroundDuringPresentation = NO;
        _searchController.hidesNavigationBarDuringPresentation = YES;
        _searchController.searchBar.placeholder = @"搜索";
        [_searchController.searchBar sizeToFit];
    }
    return _searchController;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
